home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1986 May & June
/
rerun-1986-05-06.d64
/
find it
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
5KB
|
179 lines
5 poke55,0:poke56,32:poke51,0:poke52,32:clr :rem
10 b1=36864:b2=8192:b3=21760 :rem
15 forj=b1+7tob1+77:readk:pokej,k:nextj
20 forj=b1+257tob1+308:readk:pokej,k:nextj
40 dimc$(16):fr$="n":cr$=chr$(13)
50 print"[147]":print:printtab(17)"menu":print:print:j=8 :rem
60 print" 1. find item numbers (screen output)":print :rem
70 print" 2. find item numbers (print output)":print :rem
80 print" 3. add items to the list.":print :rem
90 print" 4. check or change item categories.":print :rem
100 print" 5. update the disk file.":print :rem
110 print" 6. create a new disk file.":print :rem
120 print" 7. end this job.":print:print :rem
130 printtab(7)"(type 1 - 7 and return)":print :rem
140 inputj:ifj>7then50
150 onjgoto290,310,620,710,170,1020
160 close15:print"[145] all done.":end
170 print"[147]":print:print:print"updating "+f$+"[146] file."
180 close6:open6,8,6,"@0:"+f$+",s,w"
190 print#6,nc;cr$
200 fori=1tonc:print#6,c$(i);cr$;:nexti
210 print#6,n;cr$;
230 forj=1ton:print"";j
240 n1=peek(b2+j):n2=peek(b3+j)
260 print#6,n1;cr$;n2;cr$;
270 next j
280 close6:goto50
290 fl$="s":iffr$="n"thengosub1340
300 goto320
310 fl$="p":iffr$="n"thengosub1340
320 print"[147]":print :rem
330 print" number of items is";n:print :rem
340 gosub1180:print:print:printtab(5)"(press return key for menu)[145][145][145]" :rem
345 input" ";q$:gosub1520:ifc=0then50
350 pokeb1+134,k:pokeb1+133,j:pokeb1+132,k:pokeb1+131,j:print
360 input"inclusive or exclusive (type i or e)";c$ :rem
370 ifc$="i"then390
380 pokeb1+131,255:pokeb1+132,255
390 print"range of item search? ";:gosub1560 :rem
400 m=m2+b2+1:k=int(m/256):j=m-256*k:pokeb1+136,k:pokeb1+135,j
410 m3=m1+b2-1:k=int(m3/256):j=m3-256*k
420 poke251,j:poke252,k:poke254,k+53 :rem
430 sys(b1+7)
440 nn=peek(b1+137):ifnn>0goto460
450 print" no such item":goto590
460 iffl$="p"then520
470 print" item numbers are :"
480 fori=1tonn
490 j=peek(b1+3584+i)+256*peek(b1+3840+i)-b2
500 printj;:nexti
510 goto590
520 print" is the printer on? (y or n)
530 [161]a$:[139]a$[178]""[167]530
540 [139]a$[178]"n"[167]530
550 [139]a$[178]"y"[167]570
560 [137]530
570 [160]4: [159]4,4:[152]4," item numbers are :"
580 [152]4:[137]900
590 [141]820
600 [139]nn[179][177]255[167]320
610 j[178][194](b1[170]3839):k[178][194](b1[170]4095):[137]420
620 [139]fr$[178]"n"[167][141]1340
630 n[178]n[170]1:[153]"load":[153] :[143]
640 [139]n[179]13569[167]670 :[143]
650 [153]" the file is full. hit shift key to return to menu." :[143]
660 n[178]n[171]1:[141]830:[137]50
670 [153]" next item number is ";n :[143]
680 [153]:[141]1180
682 [153]:[153]:[153]:[153][163]5)"(press return key for menu)onononon" :[143]
685 [133]" ";q$:[141]1520
690 [139]c[178]0[167]n[178]n[171]1:[137]50
700 [151]b3[170]n,k:[151]b2[170]n,j:[137]630
710 [139]fr$[178]"n"[167][141]1340
720 [153]"load":[153]:[153]:[153] :[143]
730 [141]1180
740 [129]i[178]1[164]4:[153]:[130]:[153]" (for menu type 0 and press return)ononon" :[143]
745 [133]" item number is ";nn:[139]nn[178]0[167]50
750 [139]nn[177]n[167]720
760 [151]251,[194](b2[170]nn)
770 [151]252,[194](b3[170]nn)
780 [158](b1[170]257):[153]
790 [153]" (inspect and/or alter then return)":[133]"ononononon";q$ :[143]
800 [141]1520
810 [151]b3[170]nn,k:[151]b2[170]nn,j:[137]720
820 [153]:[153]:[153]:[153]" (press the shift key to continue)" :[143]
830 [146]653,1
840 [142]
900 m[178][181](nn[173]8):r[178]nn[171]8[172]m:[139]m[178]0[167]pr[178][171]8:[137]970
910 [129]i[178]1[164]m:pr[178]8[172](i[171]1):l$[178]""
920 [129]k[178]1[164]8:pk[178]pr[170]k
930 j[178][194](b1[170]3584[170]pk)[170]256[172][194](b1[170]3840[170]pk)[171]b2
940 j$[178][196](j):l[178][195](j$):l$[178]l$[170]j$[170][200](sp$,6[171]l)
950 [130]k:[152]4,l$:[130]i
960 [139]r[178]0[167]1010
970 l$[178]"":pr[178]pr[170]8:[129]k[178]1[164]r:pk[178]pr[170]k
980 j[178][194](b1[170]3584[170]pk)[170]256[172][194](b1[170]3840[170]pk)[171]b2
990 j$[178][196](j):l[178][195](j$):l$[178]l$[170]j$[170][200](sp$,6[171]l)
1000 [130]k:[152]4,l$
1010 [160]4:[137]590
1020 [153]"load":[153]:[133]"name of file";f$
1030 [153]:[153]"is "f$"wait a new file?close(y or n)"
1040 [161]a$:[139]a$[178]""[167]1040
1050 [139]a$[178]"y"[167]1070
1060 [137] 5
1070 [153]:[153]" how many categories";:[133]nc
1080 [129]i[178]1[164]39:[153]"-";:[130]:[153] :[143]
1090 f[178]0:[129]i[178]1[164]nc
1100 [153]"category #";i;:[133]c$(i)
1110 [130]
1120 [159]6,8,6,"0:"[170]f$[170]",s,w"
1130 [152]6,nc;cr$;
1140 [129]i[178]1[164]nc:[152]6,c$(i);cr$;:[130]
1150 n[178]0:[152]6,n:[160]6
1160 [153]:[153]"file "f$"wait has been created.
1170 gosub820:goto50
1180 printtab(7)"categories":print:print :rem
1190 ifnc/2=int(nc/2)thenk=int(nc/2):goto1260
1200 k=int(nc/2)+1
1210 fori=1tok-1:x=i:gosub1330
1220 printi$c$(i);tab(19) :rem
1230 x=i+k:gosub1330:printi$c$(i+k)
1240 next
1250 x=k:gosub1330:printi$c$(k):goto1300
1260 fori=1tok:x=i:gosub1330
1270 printi$;c$(i);tab(19) :rem
1280 x=i+k:gosub1330:printi$c$(i+k)
1290 next
1300 print"":fori=1to16:print:next :rem
1305 printtab(21)"1 1 1 1 1 1 1":rem
1310 printtab(3)"1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6" :rem
1320 return
1330 i$=mid$(str$(x),2)+". ":return :rem
1340 print"[147]":print:print:print:input"name of file";f$
1350 fr$="y":open15,8,15:open6,8,6,"0:"+f$
1360 print:print:print"reading "f$"[146] file . . .
1370 [132]6,nc
1380 [129]i[178]1[164]nc:[132]6,c$(i):[130]
1400 [132]6,n
1410 [139]n[178]0[167]630
1420 [129]j[178]1[164]n:[153]"";j
1430 [132]6,n1,n2
1450 [151]b2[170]j,n1:[151]b3[170]j,n2
1460 [130]j
1480 [160]6
1490 [142]
1520 c[178]0:[129]i[178]1787[164]1817[169]2 :[143]
1530 [139][194](i)[178]32[167]1550
1540 c[178]c[170]2[174]((i[171]1787)[173]2) :[143]
1550 [130]i:k[178][181](c[173]256):j[178]c[171]256[172]k:[142]
1560 [161]a$:[139]a$[178]""[167]1560
1570 [139]a$[178]"a"[167]m1[178]1:m2[178]n:[153]"all":[142]
1580 [153]a$;
1590 [161]b$:[139]b$[178]""[167]1590
1600 [139]b$[178]cr$[167]1630
1610 [139]b$[178][199](44)[167]m1[178][197](a$):[153]b$;:a$[178]"":[137]1590
1620 a$[178]a$[170]b$:[153]b$;:[137]1590
1630 m2[178][197](a$):[153]:[142]
1660 [131]164,251,169,0,170,133
1670 [131]251,133,253,200,208,4
1680 [131]230,252,230,254,204,135
1690 [131]144,208,11,165,252,205 :[143]
1700 [131]136,144,208,4,142,137 :[143]
1705 [131]144,96,177,251,45,131 :[143]
1710 [131]144,205,133,144,208,223 :[143]
1715 [131]177,253,45,132,144,205 :[143]
1720 [131]134,144,208,213,232,208 :[143]
1725 [131]4,202,76,35,144,152 :[143]
1730 [131]157,0,158,165,252,157 :[143]
1735 [131]0,159,76,16,144 :[143]
1740 [131]169,24,141,255,144,162 :[143]
1750 [131]0,169,34,133,253,232 :[143]
1760 [131]232,228,253,208,3,76
1770 [131]39,145,102,252,102,251 :[143]
1780 [131]176,3,76,12,145,173 :[143]
1790 [131]255,144,157,249,6,76 :[143]
1800 [131]12,145,162,34,169,0 :[143]
1810 [131]202,240,6,157,249,218 :[143]
1820 [131]76,43,145,96 :[143]